package by.grsu.hdm.model;

public abstract class Program implements IProgram {
	
	private String pid;
	private int code;
	
	protected Program() {}

	public Program(String pid) {
		this.pid = pid;
	}

	@Override
	public String getPID() {
		return this.pid;
	}

	@Override
	public ProgramStatus start() {
		this.code = 1;
		return new ProgramStatus(this.code, "Program " + this.pid + " is running.");
	}

	@Override
	public ProgramStatus close() {
		this.code = 2;
		return new ProgramStatus(this.code, "Program " + this.pid + " is closed.");
	}
}